package com.bvgol.examples.my.lambda;/**
 * @Classname AVG
 * @Description TODO
 * @Date 2023/3/13 10:06
 * @Created by GUOCHEN
 */

import com.bvgol.examples.my.list.MyList;
import com.bvgol.examples.my.stream.User;

/**
 * @program: my-spring-completely
 * @description:平均值 list中不能有null???
 * @author: GUOCHEN
 * @create: 2023/03/13 10:06
 */
public class AVG {
    public static void main(String[] args) {
        double asDouble = MyList.initUserList().stream().mapToDouble(User::getAge).average().getAsDouble();
        System.out.println("asDouble = " + asDouble);

    }
}
